const state = {
  lang: 'cs',
};
const getters = {
  langToCn: function (state) {
    switch (state.lang) {
      case 'cs':
        return '简体中文';
      case 'ts':
        return '繁体中文';
      case 'en':
        return 'English';
    }
  },
};
const actions = {
  // 异步修改
  changeLang: function (store, payload) {
    // console.log(payload);
    store.commit('CHANGE_LANG', payload);
  },
};
const mutations = {
  // 同步修改
  CHANGE_LANG: function (state, payload) {
    console.log(payload);
    //
    state.lang = payload.lang;
  },
};
export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations,
};
